﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace TiDiSun
{
    public partial class FrmThemLoaiPin : Form
    {
        public FrmThemLoaiPin()
        {
            InitializeComponent();
        }

        private void txtGiaTienLoaipin_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!Char.IsDigit(e.KeyChar) && !Char.IsControl(e.KeyChar) && e.KeyChar != '.')
            {
                e.Handled = true;
            }

        }

        private void btnThemPin_Click(object sender, EventArgs e)
        {
            LoaiPinDTO loaipin = new LoaiPinDTO();
            loaipin.TenLoai = txtTenLoaiPinK.Text;
            loaipin.TienMoiWat = Convert.ToInt32( txtGiaTienLoaipin.Text);
            LoaiPinBUS.ThemLoaiPinMoi(loaipin);
            this.Close();



        }
    }
}
